<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>SC2API: sc2::UnitQueryInterface Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="SC2-Logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">SC2API
   </div>
   <div id="projectbrief">An API for AI for StarCraft II</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>sc2</b></li><li class="navelem"><a class="el" href="classsc2_1_1_unit_query_interface.html">UnitQueryInterface</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classsc2_1_1_unit_query_interface-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">sc2::UnitQueryInterface Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span></div>  </div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;<a class="el" href="sc2__interfaces_8h_source.html">sc2_interfaces.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsc2_1_1_unit_query_interface_1_1_pathing_query.html">PathingQuery</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Issues multiple pathing queries. Same as PathingDistance(Point2D, Point2D)  <a href="structsc2_1_1_unit_query_interface_1_1_pathing_query.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsc2_1_1_unit_query_interface_1_1_placement_query.html">PlacementQuery</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Issues multiple building placement queries. Same as Placement(AbilityID, Point2D, uint64_t)  <a href="structsc2_1_1_unit_query_interface_1_1_placement_query.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ac5a203b6d8e296f4f87aed41d2f88020"><td class="memItemLeft" align="right" valign="top"><a id="ac5a203b6d8e296f4f87aed41d2f88020"></a>
virtual <a class="el" href="structsc2_1_1_available_abilities.html">AvailableAbilities</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsc2_1_1_unit_query_interface.html#ac5a203b6d8e296f4f87aed41d2f88020">GetAbilitiesForUnit</a> (uint64_t tag)=0</td></tr>
<tr class="memdesc:ac5a203b6d8e296f4f87aed41d2f88020"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a list of abilities represented as a uint32_t see the ABILITY_ID enum for their corresponding, named, representations. <br /></td></tr>
<tr class="separator:ac5a203b6d8e296f4f87aed41d2f88020"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a10d42e1451047eee4d95943cb171dd7d"><td class="memItemLeft" align="right" valign="top"><a id="a10d42e1451047eee4d95943cb171dd7d"></a>
virtual std::vector&lt; <a class="el" href="structsc2_1_1_available_abilities.html">AvailableAbilities</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsc2_1_1_unit_query_interface.html#a10d42e1451047eee4d95943cb171dd7d">GetAbilitiesForUnits</a> (const std::vector&lt; uint64_t &gt; &amp;tags)=0</td></tr>
<tr class="memdesc:a10d42e1451047eee4d95943cb171dd7d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Issues multiple available abilities queries. Same as <a class="el" href="classsc2_1_1_unit_query_interface.html#ac5a203b6d8e296f4f87aed41d2f88020" title="Returns a list of abilities represented as a uint32_t see the ABILITY_ID enum for their corresponding...">GetAbilitiesForUnit(uint64_t)</a>. <br /></td></tr>
<tr class="separator:a10d42e1451047eee4d95943cb171dd7d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5384551363a4f2e6432e2b2e5f76e954"><td class="memItemLeft" align="right" valign="top"><a id="a5384551363a4f2e6432e2b2e5f76e954"></a>
virtual float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsc2_1_1_unit_query_interface.html#a5384551363a4f2e6432e2b2e5f76e954">PathingDistance</a> (const <a class="el" href="structsc2_1_1_point2_d.html">Point2D</a> &amp;start, const <a class="el" href="structsc2_1_1_point2_d.html">Point2D</a> &amp;end)=0</td></tr>
<tr class="memdesc:a5384551363a4f2e6432e2b2e5f76e954"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns pathing distance between two locations. <br /></td></tr>
<tr class="separator:a5384551363a4f2e6432e2b2e5f76e954"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a51f4e090257661d79381070f60b83af0"><td class="memItemLeft" align="right" valign="top"><a id="a51f4e090257661d79381070f60b83af0"></a>
virtual float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsc2_1_1_unit_query_interface.html#a51f4e090257661d79381070f60b83af0">PathingDistance</a> (const uint64_t &amp;start_unit_tag, const <a class="el" href="structsc2_1_1_point2_d.html">Point2D</a> &amp;end)=0</td></tr>
<tr class="memdesc:a51f4e090257661d79381070f60b83af0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns pathing distance between a unit and a target location. Takes into account unit movement properties (eg. Flying). <br /></td></tr>
<tr class="separator:a51f4e090257661d79381070f60b83af0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8f6ebe4857fb19c9ac578f69ff9cc7f7"><td class="memItemLeft" align="right" valign="top"><a id="a8f6ebe4857fb19c9ac578f69ff9cc7f7"></a>
virtual void&#160;</td><td class="memItemRight" valign="bottom"><b>PathingDistance</b> (const std::vector&lt; <a class="el" href="structsc2_1_1_unit_query_interface_1_1_pathing_query.html">PathingQuery</a> &gt; &amp;queries, std::vector&lt; float &gt; &amp;distances)=0</td></tr>
<tr class="separator:a8f6ebe4857fb19c9ac578f69ff9cc7f7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad6579937a566b41e29c67a3443aafa4d"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsc2_1_1_unit_query_interface.html#ad6579937a566b41e29c67a3443aafa4d">Placement</a> (const <a class="el" href="classsc2_1_1_s_c2_type.html">AbilityID</a> &amp;ability, const <a class="el" href="structsc2_1_1_point2_d.html">Point2D</a> &amp;target_pos, uint64_t placing_unit_tag_=0LL)=0</td></tr>
<tr class="separator:ad6579937a566b41e29c67a3443aafa4d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a48dd3a4cdb8f30bdebf6ca8927273fbf"><td class="memItemLeft" align="right" valign="top"><a id="a48dd3a4cdb8f30bdebf6ca8927273fbf"></a>
virtual void&#160;</td><td class="memItemRight" valign="bottom"><b>Placement</b> (const std::vector&lt; <a class="el" href="structsc2_1_1_unit_query_interface_1_1_placement_query.html">PlacementQuery</a> &gt; &amp;queries, std::vector&lt; bool &gt; &amp;results)=0</td></tr>
<tr class="separator:a48dd3a4cdb8f30bdebf6ca8927273fbf"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>The <a class="el" href="classsc2_1_1_unit_query_interface.html">UnitQueryInterface</a> reflects what abilities are available for a given unit or units. Guaranteed to be valid when the OnStep event is called.</p>
<p>Performance note:</p><ul>
<li>Always try and batch things up. These queries are effectively synchronous and will block until returned. </li>
</ul>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="ad6579937a566b41e29c67a3443aafa4d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad6579937a566b41e29c67a3443aafa4d">&#9670;&nbsp;</a></span>Placement()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void sc2::UnitQueryInterface::Placement </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classsc2_1_1_s_c2_type.html">AbilityID</a> &amp;&#160;</td>
          <td class="paramname"><em>ability</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structsc2_1_1_point2_d.html">Point2D</a> &amp;&#160;</td>
          <td class="paramname"><em>target_pos</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint64_t&#160;</td>
          <td class="paramname"><em>placing_unit_tag_</em> = <code>0LL</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Returns whether a building can be placed at a location. The placing unit field is optional. This is only used for cases where the placing unit plays a role in the placement grid test. (eg. A flying barracks building an add-on requires room for both the barracks and add-on) </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>include/sc2api/<a class="el" href="sc2__interfaces_8h_source.html">sc2_interfaces.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
